local xunxun = fk.CreateSkill {

  name = "joy__xunxun",

  tags = {  },

}



xunxun:addEffect(fk.EventPhaseStart, {
  name = "joy__xunxun",
  anim_type = "control",
  events = {fk.EventPhaseStart},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(xunxun.name) and (player.phase == Player.Draw or player.phase == Player.Finish )
  end,
  on_use = function(self, event, target, player, data)
    if player.phase == Player.Draw then
      player.room:askForGuanxing(player, player.room:getNCards(4), {2, 2}, {2, 2})
    else
      player:drawCards(2,xunxun.name,"bottom")
    end
  end,
})

return xunxun